{% load staticfiles %}
<html>
<head>
<script>
function ajax_request(){
	var xmlhttp;
	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();	
	}
	else{
		xmlhttp = new ActiveXObject(Microsoft.XMLHTTP);	
	}
	
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			document.getElementById("result").innerHTML=xmlhttp.responseText;	
		}	
	}
	
	var a=document.getElementById('a').value;
	var b=document.getElementById('b').value;

	xmlhttp.open("GET","/add2/"+a+"/"+b+"/",true);
	xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
	xmlhttp.send();
}
</script>
</head>
<body>
{% static 'hello.txt' %}
<p>请输入两个数字：</p>
<form action="/add2/" method="get">
a:<input type="text" name="a" id="a"><p>
b:<input type="text" name="b" id="b"><p>
<p>result:<span id="result"></span></p>
<button type="button" onclick="ajax_request()" id="sum">求和</button>
</form>
</body>
</html>
